﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="uscBaoCaoDoanhSoNgay.ascx.cs" Inherits="WebUserControl_uscBaoCaoDoanhSoNgay" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<%@ Register src="uscMsgBox.ascx" tagname="uscMsgBox" tagprefix="uc2" %>
<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPivotGrid" tagprefix="dxwpg" %>
<%@ Register src="uscTitleForm.ascx" tagname="uscTitleForm" tagprefix="uc1" %>
<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2.Export" namespace="DevExpress.XtraPivotGrid.Web" tagprefix="dxpgw" %>
<uc1:uscTitleForm ID="uscTitleForm1" Messeage="Báo Cáo Doanh Số Ngày" runat="server" />
<br />

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    
        <table style="width:450px;">
            <tr>
                <td class="style1">
                Từ ngày
                    &nbsp; </td>
                <td>
                    &nbsp;<asp:TextBox ID="txtFromDate" runat="server">
                    </asp:TextBox>
                    <cc1:CalendarExtender ID="txtFromDate_CalendarExtender" Format="dd/MM/yyyy" runat="server" 
                        Enabled="True" TargetControlID="txtFromDate">
                    </cc1:CalendarExtender>
                    <asp:RequiredFieldValidator ControlToValidate="txtFromDate" ID="RequiredFieldValidator1" runat="server" ErrorMessage="Phải chọn thời gian">
                    </asp:RequiredFieldValidator>
                    <cc1:ValidatorCalloutExtender ID="RequiredFieldValidator1_ValidatorCalloutExtender" 
                        runat="server" TargetControlID="RequiredFieldValidator1">
                    </cc1:ValidatorCalloutExtender>
                </td>
                <td>
                    Đến ngày &nbsp;</td>
                <td>
                    <asp:TextBox ID="txtToDate" runat="server"></asp:TextBox>
                    <cc1:CalendarExtender Format="dd/MM/yyyy" ID="txtToDate_CalendarExtender" runat="server" 
                        TargetControlID="txtToDate" Enabled="True">
                    </cc1:CalendarExtender>
                     <asp:RequiredFieldValidator ControlToValidate="txtToDate" ID="RequiredFieldValidator2" runat="server" ErrorMessage="Phải chọn thời gian">
                    </asp:RequiredFieldValidator>
                    <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator2" 
                        ID="RequiredFieldValidator2_ValidatorCalloutExtender" runat="server">
                    </cc1:ValidatorCalloutExtender>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style1">
                    </td>
                <td>
                    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
                        Text="Xem báo cáo" />
                </td>
                <td>
                    </td>
                <td>
                   
                    <asp:Button ID="Button2" runat="server" onclick="Button2_Click" 
                        Text="Xuất ra Excel" />
                   
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <br />
       
         
         <dxwpg:ASPxPivotGrid ID="ASPxPivotGrid1" runat="server" 
            CustomizationFieldsVisible="True" CustomizationFieldsLeft="700" 
            CustomizationFieldsTop="400">
             <Fields>
                 <dxwpg:PivotGridField ID="field" Area="RowArea" AreaIndex="2" 
                     Caption="Nhãn hiệu" FieldName="InclassName" Visible="False">
                 </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="field1" Area="RowArea" AreaIndex="2" 
                     Caption="Sản phẩm" FieldName="ProductName" Visible="False">
                 </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="field2" Area="RowArea" AreaIndex="2" 
                     Caption="Ngành hàng" FieldName="CommodName" Visible="False">
                 </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="field3" Area="RowArea" AreaIndex="2" 
                     Caption="Mặt hàng" FieldName="ItemName" Visible="False">
                 </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="field4" Area="RowArea" AreaIndex="0" 
                     Caption="Trung tâm phân phối" FieldName="SiteCode">
                 </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="field5" Area="RowArea" AreaIndex="2" 
                     Caption="Mã hàng" FieldName="SkuCode" Visible="False">
                 </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="field6" Area="RowArea" AreaIndex="2" 
                     Caption="Mã tư vấn viên" FieldName="salespkey" Visible="False">
                 </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="field7" Area="RowArea" AreaIndex="2" 
                     Caption="Số lượng" FieldName="OffQty" Visible="False">
                 </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="field8" Area="ColumnArea" AreaIndex="0" 
                     Caption="Ngày" FieldName="OffDate">
                 </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="field9" Area="DataArea" AreaIndex="0" 
                     Caption="Số tiền" CellFormat-FormatString="{0:###,###.###}" 
                     CellFormat-FormatType="Numeric" FieldName="OffAmt">
                 </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="field10" Area="RowArea" AreaIndex="3" 
                     Caption="Tên tư vấn viên" FieldName="salespname" Visible="False">
                 </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="field11" Area="RowArea" AreaIndex="3" Caption="Tỉnh" 
                     FieldName="mprovince" Visible="False">
                 </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="field12" Area="RowArea" AreaIndex="3" Caption="Quận" 
                     FieldName="mTown" Visible="False">
                 </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="field13" Area="RowArea" AreaIndex="1" 
                     Caption="Tư vấn viên" FieldName="TVV">
                 </dxwpg:PivotGridField>
             </Fields>
        </dxwpg:ASPxPivotGrid>
        
        <br />
        <dxpgw:ASPxPivotGridExporter ID="ASPxPivotGridExporter1" runat="server" 
            ASPxPivotGridID="ASPxPivotGrid1">
        </dxpgw:ASPxPivotGridExporter>
        <br />
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="Data Source=SMART-7DC519368\SQLEXPRESS;Initial Catalog=CosmeticCenter;Integrated Security=True" 
            ProviderName="System.Data.SqlClient" SelectCommand="GET_DATA_REPORT" 
            SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:Parameter Name="TableName" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <uc2:uscMsgBox ID="uscMsgBox1" runat="server" />
        <br />
        <br />
        <br />
    </ContentTemplate>
    <Triggers> <asp:PostBackTrigger ControlID="Button2" /></Triggers>
</asp:UpdatePanel>
<p>
    &nbsp;</p>
<p>
    &nbsp;</p>
<p>
    &nbsp;</p>